﻿namespace Enter.Utils
{
    public class JsonExtend
    {
        public static string Serialize<T>(T data)
        {
            //var setting = new JsonSerializerSettings
            //{
            //    ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
            //};
            return Newtonsoft.Json.JsonConvert.SerializeObject(data);
            //return System.Text.Json.JsonSerializer.Serialize(data);
        }

        public static T Deserialize<T>(string value)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(value);
            //return System.Text.Json.JsonSerializer.Deserialize<T>(value);
        }
    }
}
